#!/usr/bin/python
# -*- coding: utf-8 -*-
import emoji
import requests
import sys
import cv2
from engine.engine import *


handsetNameSimple = {
    "wwmm":"PDAGAR9862603962",
    "szs":"PDAGAR9861601392",
    "guorui": "PDAGAM9872111074",
    "dxjd": "PDAGAM9871303794",
    "hhkb": "PDAGAR9862805822",
    "ysbhs": "PDAGAR9870900564",
               }

handsetName = {
    "PDAGAR9862603962":"line汪汪妹妹手机wx1",
    "PDAGAR9861601392":"line霜助手",
    "PDAGAM9872111074":"郭瑞用",
    "PDAGAM9871303794":"京东点犀小妹",
    "PDAGAR9862805822": "好好看吧wx2",
    "PDAGAR9870900564": "line野生渤海",
               }

handsetType = sys.argv[1]
try:

    handsetSno = handsetNameSimple[sys.argv[2]]
    if 'line' in handsetName[handsetSno]:
        setHandsetConnectByLine(handsetSno)
    print("手机序列号:"+handsetSno)
    setHandsetSno(handsetSno)
    setHandsetType(handsetType)
    debugInfo("您启动了手机 "+handsetName[handsetSno],3)

except:

    print("请使用下面的参数")
    for k,v in handsetNameSimple.items():
        print(k+"--"+v )


wakeupHandset()

class newEngine(engine):
    def __init__(self):
        engine.__init__(self)
        pass
    def __init__(self,typex,sno):
        print("newEngine init "+typex)
        debugInfo(" init "+sno)
        engine.__init__(self,typex,sno)
        pass
    def handle_msg_all(self, msg):
        super(newEngine, self).handle_msg_all(msg)
        debugInfo("子类  handle_msg_all ")
    pass


ret = isHandsetConnected("called at the start program checking")
currentEngine = newEngine(handsetType,ret)
currentEngine.runx()

